#include <stdio.h>

#define  max 65535

int main(int argc, const char *argv[]) {

    int a[max+1], i, j, k, l, n, ans;

    for (i = 0; i <= max; i++) {
        a[i] = 1;
    }

    for (i = 2; i <= max; i++) {
        for (j = i; j <= max; j += i) {
            a[j] *= -1;
        }
    }

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &l);
    
        ans = 0;
        for (j = 1; j <= l; j++) {
            if (1 == a[j]) {
                ans++;
            }
        }

        printf("%d\n", ans);
    }

    return 0;
}
